//
//  MyTableViewCell.m
//  Test passenger soldier
//
//  Created by ikuaiyue on 15/7/4.
//  Copyright (c) 2015年 shike. All rights reserved.
//

#import "MyTableViewCell.h"

@implementation MyTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _IconimageView = [[UIImageView alloc]init];
        [_IconimageView setBackgroundColor:[UIColor lightGrayColor]];
        _IDLabel = [[ZrsLabel alloc]initWithFrame:CGRectZero font:14 color:[UIColor lightGrayColor] alignment:NSTextAlignmentLeft isNumber:NO];
        _nameLabel = [[ZrsLabel alloc]initWithFrame:CGRectZero font:14 color:[UIColor lightGrayColor] alignment:NSTextAlignmentLeft isNumber:NO];
        _openNumLabel = [[ZrsLabel alloc]initWithFrame:CGRectZero font:14 color:[UIColor lightGrayColor] alignment:NSTextAlignmentLeft isNumber:NO];
        _allTimeLabel = [[ZrsLabel alloc]initWithFrame:CGRectZero font:14 color:[UIColor lightGrayColor] alignment:NSTextAlignmentLeft isNumber:NO];
        [self addSubview:_IconimageView];
        [self addSubview:_IDLabel];
        [self addSubview:_nameLabel];
        [self addSubview:_openNumLabel];
        [self addSubview:_allTimeLabel];
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _IconimageView.frame = CGRectMake(8, 8,88-16, 88-16);
    _IDLabel.frame = CGRectMake(CGRectGetMaxX(_IconimageView.frame)+4, 8, 220, (88-16)/4);
    _nameLabel.frame = CGRectMake(CGRectGetMaxX(_IconimageView.frame)+4, CGRectGetMaxY(_IDLabel.frame), 220, (88-16)/4);
     _openNumLabel.frame = CGRectMake(CGRectGetMaxX(_IconimageView.frame)+4, CGRectGetMaxY(_nameLabel.frame), 220, (88-16)/4);
    _allTimeLabel.frame = CGRectMake(CGRectGetMaxX(_IconimageView.frame)+4, CGRectGetMaxY(_openNumLabel.frame), 220, (88-16)/4);
    [_IDLabel setText:[NSString stringWithFormat:@"%@",_model.pid]];
    [_nameLabel setText:[NSString stringWithFormat:@"%@",_model.pname]];
    _openNumLabel.text = [NSString stringWithFormat:@"%@",_model.palltime];
    _allTimeLabel.text = [NSString stringWithFormat:@"%@",_model.pdata];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
